org.eclipse.vtp.desktop.projects.voice.internals.helpers
Class AlternateTextManager

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.voice.internals.helpers.AlternateTextManager

public class AlternateTextManager
extends java.lang.Object

This utility class offers a center mechanism for storeing and retrieving the alternate text associated with media files.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
AlternateTextManager()
          Creates a new AlternateTextManager.
 
Method Summary
 java.lang.String getAlternateText(AudioFile audioFile)
          Retrieves the alternate text associated with the given audio file.
static AlternateTextManager getInstance()
           
 void setAlternateText(AudioFile audioFile, java.lang.String text)
          Assigns the given alternate text to the given audio file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlternateTextManager

public AlternateTextManager()
Creates a new AlternateTextManager.

Method Detail

getInstance

public static AlternateTextManager getInstance()
Returns:
The singleton instance of this class

getAlternateText

public java.lang.String getAlternateText(AudioFile audioFile)
Retrieves the alternate text associated with the given audio file. The value will be pulled from the cache if possible, otherwise the corresponding mapping file will be loaded and cached.

Parameters:
audioFile - The audio file with the alternate text
Returns:
The alternate text associated with the file or the empty string if no alternate text is assigned

setAlternateText

public void setAlternateText(AudioFile audioFile,
                             java.lang.String text)
Assigns the given alternate text to the given audio file. The value is stored in the mapping file and the cache is also updated.

Parameters:
audioFile - The audio file that will be associated with the text
text - The alternate text to associate with the file